from glob import glob
from PIL import Image
from commands import getoutput as gop
from partition import partition
fid=open('training.txt','w')
for i in range(10):
	images = glob('Imagens_Treinamento/%d/*.tiff' % i)
	#gop('mkdir %d%s' % (i,'tiff'))
	for m in images:
		img = Image.open(m)
		partition(fid,i,img)
fid.close()
		




		#gop('convert %s %d%s/%s.tiff' % (img, i, 'tiff', img[2:-4]))
		#print 'convert %s %d%s/%s.tiff' % (img, i, 'tiff', img[:-4])
